<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no"/>
    <meta name="description" content=""  />
    <title>添加</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <script type="application/javascript">
        var prefix = "/api";
        $(function () {
            $('#submit').click(function () {
                var linkId = $("[name=linkId]").val();
                var source = $("[name=source]").val();
                console.log(linkId);
                console.log(source);
                $.ajax({
                    type: 'POST',
                    data: {
                        linkId:linkId,
                        source:source,
                    },
                    url: prefix + "/link/source/add",
                    success: function(){
                        window.location.reload();
                    }
                });
            });
        });
    </script>
</head>
<body>
<form>
    <table>
        <tr>
            <td>id</td>
            <td><input style="border: 1px solid #ccc;" name="linkId" th:value="${linkId}" /></td>
        </tr>
        <tr>
            <td valign="top">地址</td>
            <td><textarea style="border: 1px solid #ccc;" name="source" cols="40" rows="10"></textarea></td>
        </tr>
        <tr>
            <td>&nbsp;</td>
            <td><input style="border: 1px solid #ccc;" id="submit" type="button" value="提交" /></td>
        </tr>
    </table>
</form>
</body>
</html>